var api=require("../../../public/thirdapi");
cc.Class({
    extends: cc.Component,

    properties: {
        title:cc.Label,
        avatar:cc.Node,
    },

    // LIFE-CYCLE CALLBACKS:

    onLoad () {
        // console.log(this.title)
        this.touchmode=0;
        this.node.on("touchstart", this.touchStart,this);
        this.node.on("touchend", this.touchEnd,this);
    },
    touchStart(event){
        this.touchmode=1;
    },
    touchEnd(event){
        if(this.touchmode!=1){return;}
        // console.log(this.info)
        var _this=this;
        var info=this.info;
        var id=info.id;
        api.navigateToMiniProgram({
          appId: info.appid,
          path: info.path,
          extraData: {
            foo: 'bar'
          },
          envVersion: 'release',
          success(res) {
          }
        })
    },
});
